﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace SharpErp.Data.Common.Entity.Department
{
    [Serializable]
    [Table("company_staff")]
    public class CompanyStaff : Common.Entity.BaseEntity
    {
        [Column("id")]
        public int Id { get; set; }

        [Column("parent_id")]
        public int ParentId { get; set; }

        [Column("name")]
        public string Name { get; set; }

        [Column("sex")]
        public string Sex { get; set; }

        [Column("in_date")]
        public DateTime InDate { get; set; }

        [Column("position")]
        public string Position { get; set; }

        [Column("car")]
        public string Car { get; set; }

        [Column("main_goods")]
        public string MainGoods { get; set; }
        
        [Column("goods_promote")]
        public double GoodsPromote { get; set; }

        [Column("tect_promote")]
        public double TectPromote { get; set; }

        [Column("month_salary")]
        public double MonthSalary { get; set; }

        [Column("day_salary")]
        public double DaySalary { get; set; }

        [Column("account")]
        public string Account { get; set; }

        [Column("month_fee")]
        public double MonthFee { get; set; }

        [Column("day_fee")]
        public double DayFee { get; set; }

        [Column("month_pay")]
        public double MonthPay { get; set; }

        [Column("day_pay")]
        public double DayPay { get; set; }

        [Column("qichuyingshou")]
        public double QiChuYingShou { get; set; }

        [Column("qichuyingfu")]
        public double QiChuYingFu { get; set; }

        [Column("gudingzichanjin")]
        public double GuDingZiChanJin { get; set; }

        [Column("yingfu")]
        public double YingFu { get; set; }

        [Column("yanglao")]
        public double YangLao { get; set; }

        [Column("yanglao_base")]
        public double YangLaoBase { get; set; }

        [Column("yanglao_value")]
        public double YangLaoValue { get; set; }

        [Column("shiye")]
        public double ShiYe { get; set; }

        [Column("shiye_base")]
        public double ShiYeBase { get; set; }

        [Column("shiye_value")]
        public double ShiYeValue { get; set; }

        [Column("shengyu")]
        public double ShengYu { get; set; }

        [Column("shengyu_base")]
        public double ShengYuBase { get; set; }

        [Column("shengyu_value")]
        public double ShengYuValue { get; set; }

        [Column("yiliao")]
        public double YiLiao { get; set; }

        [Column("yiliao_base")]
        public double YiLiaoBase { get; set; }

        [Column("yiliao_value")]
        public double YiLiaoValue { get; set; }

        [Column("gongshang")]
        public double GongShang { get; set; }

        [Column("gongshang_base")]
        public double GongShangBase { get; set; }

        [Column("gongshang_value")]
        public double GongShangValue { get; set; }

        [Column("zhufang")]
        public double ZhuFang { get; set; }

        [Column("zhufang_base")]
        public double ZhuFangBase { get; set; }

        [Column("zhufang_value")]
        public double ZhuFangValue { get; set; }

        [Column("zhize_design")]
        public string ZhizeDesign { get; set; }

        [Column("zhize_audit")]
        public string ZhizeAudit { get; set; }

        [Column("zhize_business")]
        public string ZhizeBusiness { get; set; }

        [Column("zhize_sendin")]
        public string ZhizeSendin { get; set; }

        [Column("zhize_install")]
        public string ZhizeInstall { get; set; }

        [Column("zhize_calculate")]
        public string ZhizeCalculate { get; set; }

        [Column("zhize_manufactor")]
        public string ZhizeManufactor { get; set; }

        [Column("phone")]
        public string Phone { get; set; }

        [Column("mobile")]
        public string Mobile { get; set; }

        [Column("qq")]
        public string QQ { get; set; }

        [Column("wechat")]
        public string Wechat { get; set; }

        [Column("email")]
        public string Email { get; set; }

        [Column("identity")]
        public string Identity { get; set; }

        [Column("education")]
        public string Education { get; set; }

        [Column("birthday")]
        public DateTime Birthday { get; set; }

        [Column("important_day")]
        public DateTime ImportantDay { get; set; }

        [Column("address")]
        public string Address { get; set; }

        [Column("password_md5")]
        public string PasswordMd5 { get; set; }

        [NotMapped]
        public string ZhiZeAll {
            get {
                List<string> zhize = new List<string>();
                if (!string.IsNullOrEmpty(ZhizeDesign))
                    zhize.Add(ZhizeDesign);
                if (!string.IsNullOrEmpty(ZhizeAudit))
                    zhize.Add(ZhizeAudit);
                if (!string.IsNullOrEmpty(ZhizeBusiness))
                    zhize.Add(ZhizeBusiness);
                if (!string.IsNullOrEmpty(ZhizeSendin))
                    zhize.Add(ZhizeSendin);
                if (!string.IsNullOrEmpty(ZhizeInstall))
                    zhize.Add(ZhizeInstall);
                if (!string.IsNullOrEmpty(ZhizeCalculate))
                    zhize.Add(ZhizeCalculate);
                if (!string.IsNullOrEmpty(ZhizeManufactor))
                    zhize.Add(ZhizeManufactor);
                return string.Join(",", zhize);
            } }
    }
}
